package com.zh.work.entity.branch;

import com.baomidou.mybatisplus.annotation.*;
import com.zh.common.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.zh.work.entity.agent.AgentInfoEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * code is far away from bug with the animal protecting
 * ┏┓　　　┏┓
 * ┏┛┻━━━┛┻┓
 * ┃　　　　　　　┃
 * ┃　　　━　　　┃
 * ┃　┳┛　┗┳　┃
 * ┃　　　　　　　┃
 * ┃　　　┻　　　┃
 * ┃　　　　　　　┃
 * ┗━┓　　　┏━┛
 * 　　┃　　　┃神兽保佑
 * 　　┃　　　┃代码无BUG！
 * 　　┃　　　┗━━━┓
 * 　　┃　　　　　　　┣┓
 * 　　┃　　　　　　　┏┛
 * 　　┗┓┓┏━┳┓┏┛
 * 　　　┃┫┫　┃┫┫
 * 　　　┗┻┛　┗┻┛
 *
 * @Description: 机构实体类
 * @Author: Li.HuiNeng
 * @Create in: 2019/8/23
 * @Version: 1.0.1
 */
@ApiModel(value = "机构信息实体类")
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("branch_info")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class BranchInfoEntity extends BaseEntity implements Serializable{

  private static final long serialVersionUID = -5051537958005799449L;
  
  @ApiModelProperty(value = "主键", name = "id")
  @TableId(value = "id", type = IdType.AUTO)
  private Long id;

  @ApiModelProperty(value = "逻辑删除字段", name = "deleted")
  @TableLogic
  private Integer deleted;

  @ApiModelProperty(value = "机构代码", name = "branchNo")
  @TableField(value = "branchno")
  private String branchNo;

  @ApiModelProperty(value = "机构简称", name = "branchName")
  @TableField(value = "branch_name")
  private String branchName;

  @ApiModelProperty(value = "机构全称", name = "branchFull")
  @TableField(value = "branch_full")
  private String branchFull;

  @ApiModelProperty(value = "联系人", name = "linkMan")
  @TableField(value = "link_man")
  private String linkMan;

  @ApiModelProperty(value = "电子邮箱", name = "email")
  @TableField(value = "email")
  private String email;

  @ApiModelProperty(value = "固定电话", name = "telephone")
  @TableField(value = "telephone")
  private String telephone;

  @ApiModelProperty(value = "手机号码", name = "mobile")
  @TableField(value = "mobile")
  private String mobile;

  @ApiModelProperty(value = "地区代码", name = "areaCode")
  @TableField(value = "area_code")
  private String areaCode;

  @ApiModelProperty(value = "所在省份", name = "province")
  @TableField(value = "province")
  private String province;

  @ApiModelProperty(value = "所在城市", name = "city")
  @TableField(value = "city")
  private String city;

  @ApiModelProperty(value = "详细地址", name = "address")
  @TableField(value = "address")
  private String address;

  @ApiModelProperty(value = "业务编码(即商户和代理商编码前3位)", name = "bizCode")
  @TableField(value = "biz_code")
  private String bizCode;

  @ApiModelProperty(value = "代理商审核模式1-无需审核 2-仅机构审核", name = "agentAuditMode")
  @TableField(value = "agent_audit_mode")
  private Integer agentAuditMode;

  @ApiModelProperty(value = "商户审核模式1-无需审核 2-机构复审 3-机构初审+复审", name = "merchAuditMode")
  @TableField(value = "merch_audit_mode")
  private Integer merchAuditMode;

  @ApiModelProperty(value = "商户默认的MCC码", name = "merchDefaultMcc")
  @TableField(value = "merch_default_mcc")
  private String merchDefaultMcc;

  @ApiModelProperty(value = "开通一机多费率(1-未开通 2-已开通)", name = "openMulti")
  @TableField(value = "open_multi")
  private Integer openMulti;

  @ApiModelProperty(value = "开通T+0(1-未开通 2-已开通)", name = "openT0")
  @TableField(value = "open_t0")
  private Integer openT0;

  @ApiModelProperty(value = "商户是否需要总公司终审（1：不需要 2：需要）", name = "merchAuditJudg")
  @TableField(value = "merch_audit_judg")
  private Integer merchAuditJudg;

  @ApiModelProperty(value = "T0最低消费金额", name = "t0MinAmount")
  @TableField(value = "t0_min_amount")
  private BigDecimal t0MinAmount;

  @ApiModelProperty(value = "T+0的费率", name = "t0Rate")
  @TableField(value = "t0_rate")
  private BigDecimal t0Rate;

  @ApiModelProperty(value = "机构LOGO", name = "branchLogo")
  @TableField(value = "branch_logo")
  private String branchLogo;

  @ApiModelProperty(value = "机构系统名称", name = "branchSystemName")
  @TableField(value = "branch_system_name")
  private String branchSystemName;

  @ApiModelProperty(value = "录入时间", name = "addTime")
  @TableField(value = "add_time")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date addTime;

  @ApiModelProperty(value = "T+0结算费率", name = "t0SettleRate")
  @TableField(value = "t0_settle_rate")
  private BigDecimal t0SettleRate;


  @ApiModelProperty(value = "T+1结算费率", name = "t1SettleRate")
  @TableField(value = "t1_settle_rate")
  private BigDecimal t1SettleRate;

  @ApiModelProperty(value = "提现费", name = "withdrawalFee")
  @TableField(value = "withdrawal_fee")
  private BigDecimal withdrawalFee;


  @ApiModelProperty(value = "提醒类型1.短信，2.邮件", name = "remindType")
  @TableField(value = "remind_type")
  private Integer remindType;

  @ApiModelProperty(value = "费用类型", name = "feeType")
  @TableField(value = "fee_type")
  private Integer feeType;

  @ApiModelProperty(value = "业务员id", name = "salerId")
  @TableField(value = "saler_id")
  private Integer salerId;
  @ApiModelProperty(value = "业务员", name = "salerName")
  @TableField(exist = false)
  private String salerName;

  @ApiModelProperty(value = "结算账号", name = "accountNo")
  @TableField(value = "accountno")
  private String accountNo;

  @ApiModelProperty(value = "账户户名", name = "accountName")
  @TableField(value = "account_name")
  private String accountName;

  @ApiModelProperty(value = "开户行号", name = "bankNo")
  @TableField(value = "bankno")
  private String bankNo;

  @ApiModelProperty(value = "开户行", name = "bankName")
  @TableField(value = "bank_name")
  private String bankName;

  @ApiModelProperty(value = "T1最低消费金额", name = "t1MinAmount")
  @TableField(value = "t1_min_amount")
  private BigDecimal t1MinAmount;

  @ApiModelProperty(value = "商户最低手续费", name = "merchMinFee")
  @TableField(value = "merch_min_fee")
  private BigDecimal merchMinFee;

  @ApiModelProperty(value = "微信费率", name = "wxRate")
  @TableField(value = "wx_rate")
  private BigDecimal wxRate;

  @ApiModelProperty(value = "支付宝费率", name = "zfbRate")
  @TableField(value = "zfb_rate")
  private BigDecimal zfbRate;

  @ApiModelProperty(value = "百度钱包费率", name = "bdRate")
  @TableField(value = "bd_rate")
  private BigDecimal bdRate;

  @ApiModelProperty(value = "QQ钱包费率", name = "qqRate")
  @TableField(value = "qq_rate")
  private BigDecimal qqRate;

  @ApiModelProperty(value = "京东费率", name = "jdRate")
  @TableField(value = "jd_rate")
  private BigDecimal jdRate;

  @ApiModelProperty(value = "网关T1费率", name = "gatewayRateT1")
  @TableField(value = "gateway_rate_t1")
  private BigDecimal gatewayRateT1;

  @ApiModelProperty(value = "网关T0费率", name = "gatewayRateT0")
  @TableField(value = "gateway_rate_t0")
  private BigDecimal gatewayRateT0;

  @ApiModelProperty(value = "公众号ID", name = "appId")
  @TableField(value = "app_id")
  private String appId;

  @ApiModelProperty(value = "T+1最低交易金额", name = "qrcodeT1Min")
  @TableField(value = "qrcode_t1_min")
  private BigDecimal qrcodeT1Min;

  @ApiModelProperty(value = "T+0最低交易金额", name = "qrcodeT0Min")
  @TableField(value = "qrcode_t0_min")
  private BigDecimal qrcodeT0Min;

  @ApiModelProperty(value = "提现费成本", name = "qrcodeWithdrawalCost")
  @TableField(value = "qrcode_withdrawal_cost")
  private BigDecimal qrcodeWithdrawalCost;

  @ApiModelProperty(value = "商户提现费", name = "qrcodeWithdrawalMerch")
  @TableField(value = "qrcode_withdrawal_merch")
  private BigDecimal qrcodeWithdrawalMerch;

  @ApiModelProperty(value = "商户最低手续费", name = "qrcodeMinFee")
  @TableField(value = "qrcode_min_fee")
  private BigDecimal qrcodeMinFee;

  @ApiModelProperty(value = "二维码T+1业务(1-关闭 2-开通)", name = "openQrcodeT1")
  @TableField(value = "open_qrcode_t1")
  private Integer openQrcodeT1;

  @ApiModelProperty(value = "二维码T+0业务(1-关闭 2-开通)", name = "openQrcodeT0")
  @TableField(value = "open_qrcode_t0")
  private Integer openQrcodeT0;

  @ApiModelProperty(value = "1-手机登录 2-邮箱登录", name = "loginType")
  @TableField(value = "login_type")
  private Integer loginType;

  @ApiModelProperty(value = "快捷T+1成本", name = "quickT1Cost")
  @TableField(value = "quick_t1_cost")
  private BigDecimal quickT1Cost;

  @ApiModelProperty(value = "快捷T+0成本", name = "quickT0Cost")
  @TableField(value = "quick_t0_cost")
  private BigDecimal quickT0Cost;

  @ApiModelProperty(value = "快捷T+二维码费率实体信息", name = "branchFeeList")
  @TableField(value = "branchFee",exist = false)
  private String branchFee;

  @ApiModelProperty(value = "省市区数据", name = "provinceCity")
  private String provinceCity;


  @ApiModelProperty(value = "下属代理商集合", name = "children")
  @TableField(exist = false)
  private List<AgentInfoEntity> children;



  public BranchInfoEntity() { }

  public BranchInfoEntity(Long id, String branchNo, String branchName) {
    this.id = id;
    this.branchNo = branchNo;
    this.branchName = branchName;
  }

  @Override
  public String toString() {
    return "id=" + id +
            ", branchNo='" + branchNo + '\'' +
            ", branchName='" + branchName + '\'';

  }
}
